	function add() {
        $("#jobName").val("");
        $("#jobGroupName").val("");
        $("#jobClass").val("");
        $("#triggerName").val("");
        $("#triggerGroupName").val("");
        $("#cronExpression").val("");
        $("#callBack").val("");
	}

    // 编辑数据行
	function edit(jobName) {
        $("#home").removeClass("active");
        $("#menu1").addClass("active");
        $.ajax({type: "GET", url: "/api/schedu/oneApi",
            data: {"jobName": jobName,}, dataType: "json",
            success: function(data){
                if(data.code==200) {
                    let loads = eval(data.data);
                    $("#jobName").val(loads['jobName']);
                    $("#jobGroupName").val(loads['jobGroup']);
                    $("#jobClassSelect").val(loads['jobClassName']);
                    $("#triggerName").val(loads['triggerName']);
                    $("#triggerGroupName").val(loads['triggerGroup']);
                    $("#cronExpressionInput").val(loads['cronExpression']);
                    $("#callBackInput").val(loads['callBack']);
                }
            }
        });
	}

	function save(){
        let jobName = $("#jobName").val();
        let jobGroupName = $("#jobGroupName").val();
        let triggerName = $("#triggerName").val();
        let triggerGroupName = $("#triggerGroupName").val();
        let jobClass = $("#jobClass").val()
        let cronExpression = $("#cronExpressionInput").val();
        let callBack = $("#callBackInput").val();
	    handleUpdate (jobName, jobGroupName, triggerName, triggerGroupName, jobClass, cronExpression, callBack);
	}

    //更新
    function handleUpdate (jobName, jobGroupName, triggerName, triggerGroupName, jobClass, cronExpression, callBack) {
        $.ajax({type: "PUT", url: "/api/schedu/handleUpdate",
            data: {"jobName": jobName,"jobGroupName": jobGroupName,"triggerName": triggerName,
                "triggerGroupName": triggerGroupName,"jobClass": jobClass, "cronExpression": cronExpression,
                "callBack": callBack}, dataType: "json",
            success: function(data){
                if(data.code==200){
                    window.location.reload();
                }
            }
        });
    }

    //单行删除
    function handleDelete(jobName, jobGroup) {
        $.ajax({type: "PUT", url: "/api/schedu/handleDelete",
            data: {"jobName": jobName,"jobGroupName": jobGroup}, dataType: "json",
            success: function(data){
                if(data.code==200){
                    window.location.reload();
                }
            }
        });
    }

    //暂停任务
    function handlePause(jobName, jobGroup) {
        $.ajax({type: "PUT", url: "/api/schedu/handlePause",
            data: {"jobName": jobName,"jobGroupName": jobGroup}, dataType: "json",
            success: function(data){
                if(data.code==200){
                    window.location.reload();
                }
            }
        });
    }

    //恢复任务
    function handleResume(jobName, jobGroup) {
        $.ajax({type: "PUT", url: "/api/schedu/handleResume",
            data: {"jobName": jobName,"jobGroupName": jobGroup}, dataType: "json",
            success: function(data){
                if(data.code==200){
                    window.location.reload();
                }
            }
        });
    }

    //刷新启动时间
    function handleRef(jobName, jobGroup) {
        $.ajax({type: "PUT", url: "/api/schedu/handleRef",
            data: {"jobName": jobName,"jobGroupName": jobGroup}, dataType: "json",
            success: function(data){
                if(data.code==200){
                    window.location.reload();
                }
            }
        });
    }

    function chooseSample(jobName){
        $("#home").removeClass("active");
        $("#menu1").addClass("active");
        $.ajax({type: "GET", url: "/schedu/one",
            data: {"jobName": jobName,}, dataType: "json",
            success: function(data){
                if(data.code==200) {
                    let loads = eval(data.data);
                    $("#jobName").val(loads['jobName']);
                    $("#jobGroupName").val(loads['jobGroupName']);
                    $("#jobClass").val(loads['jobClass']);
                    $("#triggerName").val(loads['triggerName']);
                    $("#triggerGroupName").val(loads['triggerGroupName']);
                    $("#cronExpressionInput").val(loads['cronExpression']);
                    $("#callBackInput").val(loads['callBack']);
                }
            }
        });
    }

    function setCronExpression(readFlg, val){
        if (readFlg) {
            $("#callBackInput").val(val.title);
            if($("#callBackInput").attr("readonly") != true){
                $("#callBackInput").attr("readonly");
            }
        } else {
            $("#callBackInput").removeAttr("readonly");
            $("#callBackInput").val(val.title);
        }
    }